function sequence = ManualSequence( HardwareChannels , M )
%MANUALSEQUENCE Summary of this function goes here
%   Detailed explanation goes here
    L=2*ceil(M/2) - 1;
    L0= floor(L/2);

    Areal = randsrc(HardwareChannels,M,[linspace(-1,-0.5,1000),linspace(0.5,1,1000)]);
    Aimg = randsrc(HardwareChannels,M,[linspace(-1,-0.5,1000),linspace(0.5,1,1000)]);
    A = Areal+1j*Aimg;
    Anorm = repmat(sqrt(diag(A*A')),[1,255]);
    A=A./Anorm;
    
    %% compute F,D matrixes
    theta = exp(-1i*2*pi/M);
    F = theta.^([0:M-1]'*[-L0:L0]);
    np = 1:L0;
    nn = (-L0):1:-1;
    dn = [   (1-theta.^nn)./(2*1i*pi*nn)      1/M    (1-theta.^np)./(2*1i*pi*np)];
    D = diag(dn);
    
    %%
    S = A *transp(F*D)*inv( F*D*transp(F*D));
    sA  =abs(S);
    sMedian = median(sA,2);
    sequence = -1*ones(size(A,1),M);

    for k=1:size(A,1)
        sequence(k,sA(k,:) >=sMedian(k))  =1;
    end

end

